package com.codegeek.project.mybatisTypeHandler.struct;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.List;

/**
 * @author wj
 * @ClassName
 * @Description
 * @date 2020-02-20
 */
public class CGSensorTypeParam {

    public static final Logger logger = LogManager.getLogger("FileUtils");

    /** 参数名称*/
    private String name;

    /** 参数描述*/
    private String description;

    /** 参数值*/
    private Float value;

    /** 参数单位*/
    private String unit;
    /**
     * @title
     * @description 默认构造
     * @param
     * @return
     * @throws
     */
    public CGSensorTypeParam(){

    }

    static public List<CGSensorTypeParam> parseListFromJsonString(String strParam){
        try {
            return JSONArray.parseArray(strParam,CGSensorTypeParam.class);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e);
            return null;
        }
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Float getValue() {
        return value;
    }

    public void setValue(Float value) {
        this.value = value;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }
}
